package com.cn.xact.ty_treasured_book.activity;

import com.cn.xact.ty_treasured_book.R;
import com.cn.xact.ty_treasured_book.R.layout;
import com.cn.xact.ty_treasured_book.R.menu;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;

public class PhoneGuideForMailActivity extends Activity {

    private OnClickListener mPageListener = new OnClickListener() {

        @Override
        public void onClick(View arg0) {
            Intent tmp = new Intent(PhoneGuideForMailActivity.this, PhoneGuideAppForMailActivity.class);
            startActivity(tmp);
        }

    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
        setContentView(R.layout.activity_phone_guide_for_mail);

        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.common_customer_title);

        ImageView tmp = (ImageView)findViewById(R.id.common_title_indicator);
        tmp.setImageResource(R.drawable.phone_guide);
        TextView title1 = (TextView)findViewById(R.id.common_title_first_section);
        title1.setText(R.string.guide_title);
        TextView separator1 = (TextView)findViewById(R.id.common_title_first_separator);
        separator1.setVisibility(View.VISIBLE);
        TextView title2 = (TextView)findViewById(R.id.common_title_second_section);
        title2.setText(R.string.guide_title_mail);
        title2.setVisibility(View.VISIBLE);
        TextView separator2 = (TextView)findViewById(R.id.common_title_second_separator);
        separator2.setVisibility(View.VISIBLE);
        TextView title3 = (TextView)findViewById(R.id.common_title_third_section);
        title3.setText(R.string.detail);
        title3.setVisibility(View.VISIBLE);

        title2.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // TODO Auto-generated method stub
                PhoneGuideForMailActivity.this.finish();
            }

        });

        TextView title = (TextView)findViewById(R.id.guide_mail_title);
        TextView content = (TextView)findViewById(R.id.guide_mail_content);

        title.setOnClickListener(mPageListener);
        content.setOnClickListener(mPageListener);

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.phone_guide_for_mail, menu);
        return true;
    }

}
